package top.infopub.mgr.cap.dao;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.infopub.mgr.cap.domain.DropLoanFinDomain;
import top.infopub.mgr.cap.vo.RepaymentScheduleInfoVo;
import top.infopub.model.cap.InformationSubmitApproval;
import top.infopub.model.cap.LoanContract;
import top.infopub.model.cap.LoanContractSublist;
import top.infopub.model.cap.SetupFinancial;

import java.util.List;
import java.util.Map;

/**
 * @Author Warking
 * @Date 2021/5/24 9:36
 * @Version 1.0  借款合同
 */
@Repository
public interface LoanContractDao {
    /*借款合同列表接口*/
    Page<LoanContract> selectPage(LoanContract loanContract);
    /*根据ID查询主表数据*/
    LoanContract findById(@Param("id") String id);
    //根据主表ID查询子表数据
    List<LoanContractSublist> selectSublistById(@Param("id")String id);
    /*根据子表金融ID去查询金融机构的数据*/
    SetupFinancial findBySublistId(@Param("setupFinancialId")String setupFinancialId,@Param("loanContractId")String loanContractId);
    /*主表保存*/
    void saveLoanContract(LoanContract loanContract);
    /*子表保存*/
    void saveLoanContractSublist(LoanContractSublist sublist);
    /*主表修改*/
    void updateLoanContract(LoanContract loanContract);
    /*子表修改*/
    void updateLoanContractSublist(LoanContractSublist sublist);
    /*项目下拉接口  从金融机构选择 查询*/
    List<Map<String,String>> selectProCode();

    List<DropLoanFinDomain> selectProject();

    List<RepaymentScheduleInfoVo> selectDockById(String id);
    /*查询是否已经存在相同的项目*/
    String selectByProCodeFlag(@Param("proCode")String proCode);
}
